package com.situ.supermarket.controller;

import com.situ.supermarket.entity.Purchase;
import com.situ.supermarket.entity.User;
import com.situ.supermarket.service.PurchaseService;
import com.situ.supermarket.service.impl.PurchaseServiceImpl;
import com.situ.supermarket.vo.ResultVO;
import com.situ.supermarket.vo.TableVO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;

@WebServlet("/purchase")
public class PurchaseController extends BaseController{
    PurchaseService service = new PurchaseServiceImpl();
    public void page(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getRequestDispatcher("/WEB-INF/purchase.jsp").forward(request,response);
    }
    public TableVO select(Integer page, Integer limit, String name, String employeeName){
        return service.select(page,limit,name,employeeName);
    }
    public void delete(Integer id){
        service.delete(id);
    }

    public TableVO save(Purchase p){
        return service.save(p);
    }
    public Purchase info(Integer id) {
        return service.info(id);
    }

}
